package com.longshihan.gril.exception;

import com.longshihan.gril.entity.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class ExceptionHandler {

    @org.springframework.web.bind.annotation.ExceptionHandler(value = Exception.class)
    @ResponseBody
    public Result handle(Exception e) {
        if (e instanceof GrilException) {

            GrilException grilException = (GrilException) e;
            return new Result();
        } else {
            return new Result();
        }
    }
}
